1. Field of the Invention
This invention relates to an inclination detecting device for use in an image reading apparatus.
2. Description of the Related Art
Where printed documents are optically read, and accumulated or transmitted as digital image data, a compression is performed in order to reduce the amount of data to be accumulated or transmitted. At the time of compression, the structure of each document is analyzed, with the result that character portions thereof are recognized and encoded, or image portions are taken out and compressed, in order to enhance the compression efficiency. However, if an inclined document is input, it cannot be read correctly. To avoid this, it is necessary to detect the inclination of the document and correct the inclination before reading and compression processing.
In general, a method is employed, which utilizes characters arranged in line to detect the inclination of a document inputted in an inclined manner. In the prior art disclosed, for example, in Jpn. Pat. Appln. KOKAI Publication No. 63-282584, the number of white pixels are counted, which continuously extend from two side edges substantially perpendicular to the direction in which characters are arranged, thereby detecting peripheral features, determining the direction of rotation from the negative and positive averages of the first-order differentiation values of the peripheral features, and extracting points corresponding to the peripheral features in accordance with the direction of rotation. Thus, the inclination of the document is detected.
As is shown in FIG. 14, the conventional inclination detecting device comprises: a digitizing section 1 for converting to a binary number signal a document image obtained by optically scanning each document; a peripheral feature extracting section 2 for extracting the peripheral features of the document image digitized in the digitizing section 1, from two side edges substantially perpendicular to each line of characters contained in the document image; a first-order differentiation section 3 for subjecting the peripheral features to first-order differentiation; a rotational direction detecting section 4 for determining the direction of rotation from the negative and positive averages of the first-order differentiation values; a corresponding point extracting section 5 for extracting two corresponding points of the peripheral features in accordance with the direction of rotation; and an inclination detecting section 6 for detecting the inclination of the document image on the basis of the extracted corresponding points.
In the above-described structure, the digitized document image has its peripheral features extracted in the peripheral feature extracting section 2. The extraction is performed by scanning a document image from two side edges substantially perpendicular to each line of characters in the document image (for example, the right and left sides in the case where the character line is horizontal), thereby counting the number of white pixels until a first black pixel is detected. The extracted left and right peripheral features are subjected to first-order differentiation in the first-order differentiation section 3. In the rotational direction detecting section 4, the positive and negative averages of one (e.g., the left one) of the differentiated left and right peripheral features are calculated. If the positive average is higher than the negative average, it is determined that forward rotation has been performed, whereas if the negative average is higher than the positive average, it is determined that backward rotation has been performed. In the corresponding point extracting section 5, varied points of the left and right peripheral features are detected, and the relationship therebetween is determined in accordance with the direction of rotation. In the inclination detecting section 6, the angle of inclination is determined with the use of the corresponding points. Thus, the inclination of the input document image is detected.
In the prior art, there are some other inclination detecting methods as follows:
A method wherein the outline of an image is extracted, a circumscribed rectangle of the image is obtained, feature amounts are integrated by sequentially changing the angle of scanning where the feature amount indicates the bottom side of the rectangle and the lower left vertex of the rectangle indicates the position coordinates, thereby detecting the direction in which a sharpest peak is found in a histogram indicating the integration results, to determine the inclination of the image. A method wherein a candidate point for inclination detection is determined on the basis of the arrangement of black and white pixels in a diagonal line of an input image, the continuity of white pixels from the candidate point is inspected, and the center point of the width of an angle at which the longest white run is detected is obtained, to detect the inclination of the image. A method wherein the degree of complexity is determined on the basis of the number of times of shift from a white pixel to a black pixel as a result of scanning an input image, a candidate region for inclination detection is obtained from complexity degrees in the horizontal direction, and the direction in which the greatest complexity is obtained is determined as a result of sequentially changing the scanning angle, to detect the inclination of the image.
In order to effectively detect the inclination of a document image even where there is no linear line of characters therein, it is required that the inclination of the image be detected from a local region of the image; in other words, the inclination of the image be determined from the inclination of e.g. a character itself. However, in the prior art, detection of inclination cannot be performed without utilizing linear arrangement of characters.
Moreover, the conventional inclination detection is complicated, and hence requires long time and large-scale hardware.